<template>
  <div class="sso-container">
    <!-- 联云logo -->
    <div>
      <img class="lylogo" src="@/assets/images/lylogo.png" alt="" />
    </div>
    <div class="login-info">
      <!-- 登录模块 -->
      <div class="login">
        <div class="login-layout">
          <h2 class="projectName">{{ projectName }}</h2>
          <el-button
            class="sso-btn"
            @click="ssoLogin"
            type="primary"
            :disabled="!isAgree"
            >系统登录</el-button
          >
          <div class="user-manage">
            <el-checkbox v-model="isAgree"></el-checkbox>
            <span class="agreement">同意《用户管理办法》</span>
          </div>
          <div class="manual">
            <img class="img-class" src="@/assets/images/manual.png" alt="" />
            <img
              class="img-class"
              src="@/assets/images/manual-desc.png"
              alt=""
            />
          </div>
        </div>
      </div>
      <!-- 平台技术服务 -->
      <div class="serve">
        <h2>平台技术服务</h2>
        <h2>格力掌上通工作组：2613@gree.com.cn</h2>
        <h2>联系电话：54537/0759-8572537</h2>
      </div>
    </div>
  </div>
</template>

<script lang="ts" setup>
const projectName = import.meta.env.VITE_APP_TITLE;
const isAgree = ref<boolean>(localStorage.getItem("isAgree") === "true");

watch(
  () => isAgree,
  (val) => {
    localStorage.setItem("isAgree", val.toString());
  }
);

const ssoLogin = () => {
  location.href = import.meta.env.VITE_CALLBACK;
};
</script>
<style lang="scss" scoped>
h2 {
  margin: 0;
  padding: 0;
}
.sso-container {
  width: 100%;
  height: 100vh;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center center;
  background-image: url("../../assets/images/login-bg.png");
  display: flex;
  justify-content: space-between;
  .lylogo {
    width: 157px;
    height: 28px;
    margin-left: 40px;
    margin-top: 32px;
  }
  .login-info {
    background-color: rgba(255, 255, 255, 0.95); // 42 71 92
    width: 640px;
    height: 100vh;
    .login {
      height: calc(100vh - 157px);
      width: 640px;
      display: flex;
      align-items: center;
      justify-content: center;
      .login-layout {
        width: 640px;
        .projectName {
          height: 45px;
          font-size: 32px;
          font-family: PingFang SC, PingFang SC-Semibold;
          font-weight: 600;
          color: #0b3ba7;
        }
        .sso-btn {
          margin-top: 42px;
          width: 378px;
          height: 55px;
        }
        .user-manage {
          text-align: left;
          margin-left: 131px;
          margin-top: 18px;
          .agreement {
            margin-left: 8px;
            text-decoration: underline;
          }
        }
        .manual {
          text-align: left;
          margin-left: 131px;
          margin-top: 36px;
          .img-class {
            width: 110px;
            height: 138px;
          }
          :nth-child(1) {
            margin-right: 32px;
          }
        }
      }
    }
    .serve {
      height: 157px;
      h2 {
        font-size: 14px;
        font-family: PingFang SC, PingFang SC-Regular;
        font-weight: 400;
        color: #000000;
      }
      :nth-child(2) {
        margin-top: 18px;
      }
      :nth-child(3) {
        margin-top: 14px;
      }
    }
  }
}
</style>
